const mixin = {
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    name: String,
    label: String,
    rules: {
      type: Array,
      default() {
        return [{ required: true, message: '请填写' }]
      }
    },
    required: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    vModelValue: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('change', val)
      }
    }
  }
}

export default mixin
